<!--根据这个页单独设置样式-->
<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
</style>
<script type="text/ng-template" id="managerAdminNodeModal.html">
    <div class="modal-header">
        <h3 class="modal-title">{{info.state?'编辑':'添加'}}{{info.type}}</h3>
    </div>
    <div class="modal-body">
        <form name="form" class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-12"><label>{{info.type}}节点名字</label></div>
                <div class="col-sm-12">
                    <input type="text" ng-model="info.node" class="form-control ">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12"><label>标题<em class="text-muted">节点的标题释义</em></label></div>
                <div class="col-sm-12">
                    <input type="text" ng-model="info.info" class="form-control ">
                </div>
            </div>
            <div class="form-group" ng-if="info.type!='控制器'">
                <div class="col-sm-12">
                    <label class="control-label">父亲</label>
                </div>
                <div class="col-sm-12">
                    <select type="text" class="form-control"
                            ng-model="info.parents"
                            ng-options = "p.id as p.info for p in parent">
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12"><label>备注</label></div>
                <div class="col-sm-12">
                    <textarea class="form-control" ng-model="info.remarks" rows="10"></textarea>
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>
<div ng-controller="managerAdminNodeListCtrl">
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">admin节点列表</h1>
    </div>
    <div class="wrapper-md" >
        <div class="panel panel-default">
            <div class="panel-heading">
                <label class="control-label ">admin节点列表</label>
                <a class="btn btn-defaul btn-addon btn-sm pull-right m-r-sm" href="javascript:history.go(-1)"><i class="fa fa-mail-reply"></i>返回</a>
                <button class="btn btn-info btn-addon btn-sm pull-right m-r-sm" ng-click="model.save(0,1)"><i class="fa fa-plus"></i>添加方法节点</button>
                <button class="btn btn-info btn-addon btn-sm pull-right m-r-sm" ng-click="model.save(0,0)"><i class="fa fa-plus"></i>添加控制器节点</button>
            </div>
            <div class="table-responsive">
                <table class="table table-striped  b-t b-light">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>节点名字</th>
                        <th>释义</th>
                        <th>类型</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="data in vm.data">
                        <td>{{data.id}}</td>
                        <td>
                            {{data.node}}
                        </td>
                        <td>
                            {{data.info}}
                        </td>
                        <td>
                            <span class="label bg-success" ng-class="{'bg-info':data.type=='方法'}">{{data.type}}</span></td>
                        <td>
                            {{data.remarks}}
                        </td>
                        <td>
                            <a class="btn btn-primary btn-sm" ng-click="model.save(1,data)">编辑</a>
                            <a class="btn btn-sm btn-danger" ng-click="model.del(data.id)">删除</a>
                        </td>
                    </tr>
                    <tr  ng-if="!vm.data.length" class="text-center">
                        <td colspan="6">暂无数据！</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-2 hidden-xs">
                        <select
                                class="input-sm form-control w-sm inline v-middle"
                                ng-model="placement.selected"
                                ng-options="o as o for o in placement.options"
                                ng-change="placement.changeFn()"
                        >
                        </select>
                        <i style="float: right;padding: 2% 15% 0 0">总计{{vm.page.rowtotal}}</i>
                    </div>
                    <div class="col-sm-10 text-right text-center-xs">
                        <div class="pagination pagination-sm m-t-none m-b-none">
                            <uib-pagination
                                    boundary-links="true"
                                    total-items="vm.page.rowtotal"
                                    max-size="placement.pageSize"
                                    items-per-page="placement.selected"
                                    ng-model="vm.page.currentpage"
                                    ng-change="pageChanged()"
                                    class="pagination-sm"
                                    previous-text="&lsaquo;"
                                    next-text="&rsaquo;"
                                    first-text="&laquo;"
                                    last-text="&raquo;"
                            >
                            </uib-pagination>
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>
